package com.hnhcyy.goods;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@MapperScan(basePackages="com.hnhcyy.goods.mapper")
@ComponentScan(basePackages= {"com.hnhcyy.goods","com.hnhcyy.b2b.common","com.hnhcyy.b2b.promotion.client"})
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.hnhcyy.b2b.promotion"})
@EnableSwagger2
public class GoodsApplication {

	public static void main(String[] args) {
		 /**
         * Springboot整合Elasticsearch 在项目启动前设置一下的属性，防止报错
         * 解决netty冲突后初始化client时还会抛出异常
         * java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4]
         */
//        System.setProperty("es.set.netty.runtime.available.processors", "false");
		SpringApplication.run(GoodsApplication.class, args);
	}
}
